import { OnInit, Component, ViewChild } from '@angular/core';
import { StudentCourseListComponent } from './student-course-list.component';

@Component({
  selector: 'app-student-course-view',
  templateUrl: './student-course-view.component.html',
  styles: [],
})
export class StudentCourseViewComponent implements OnInit {
  constructor() {}

  @ViewChild('studentCourseListComponent', { static: false })
  studentCourseListComponent: StudentCourseListComponent;

  /**
   * 条件查询参数
   */
  queryParams = {
    courseName: null,
    teacherName: null,
    year: null,
    termType: null,
    studyStatus: null,
  };

  /**
   * 添加班级
   */
  create() {
    this.studentCourseListComponent.create();
  }

  /**
   * 刷新
   */
  reflesh() {
    this.studentCourseListComponent.loadData();
  }

  /**
   * 查询
   */
  onSearch() {
    this.studentCourseListComponent.loadData();
  }

  /**
   * 重置表单
   */
  onResetForm() {
    this.queryParams.courseName = null;
    this.queryParams.teacherName = null;
    this.queryParams.year = null;
    this.queryParams.termType = null;
    this.queryParams.studyStatus = null;
  }

  ngOnInit() {}
}
